import json
from flask import request

def get_data():
    data = request.data
    if data:
        data = json.loads(data)
    else:
        data = request.form
    return data